﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WFBot.Framework.Domain;
using WFBot.Framework.Repositories;

namespace WFBot.Data.Repository
{
    public class OperatorRepository : RepositoryBase<Operator>, IOperatorRepository
    {
        public OperatorRepository(IDatabaseFactory databaseFactory)
            : base(databaseFactory)
        {
        }

        public Operator GetBySipUri(string sipUri)
        {
            return Database.Operators.FirstOrDefault(o => o.SipUri == sipUri);
        }

        public Operator GetByChannel(string channel)
        {
            return Database.Operators.FirstOrDefault(o => o.CurrentChannel == channel);
        }
    }
}
